#ifndef _MOTOR_CONTROLLER_H
    #define _MOTOR_CONTROLLER_H
    #include "Arduino.h"

class MotorController {
    private:
    int right_pin;
    int left_pin;
    int sensor_pin_A;
    int sensor_pin_B;
    int type;

    public:
    MotorController(int right_pin, int left_pin,int sensor_pin_A) {
        this->right_pin = right_pin;
        this->left_pin = left_pin;
        this->sensor_pin_A = sensor_pin_A;
        this->type = 1;
    }

        void init(){
            pinMode(right_pin, OUTPUT);
            pinMode(left_pin, OUTPUT);
        }
        void setSpeed(int speed) {
            if(speed > 0){
                analogWrite(right_pin, speed);
                analogWrite(left_pin, 0);
            }else{
                analogWrite(right_pin, 0);
                analogWrite(left_pin, -speed);
            }
        }

    };

#endif